package com.moss.cloud.auth.biz.exception;

import com.moss.cloud.common.core.exception.ErrorType;
import lombok.Getter;

/**
 * 全局异常定义--认证异常
 * @author 瑾年
 * @data 2023年3月6
 */
@Getter
public enum AuthErrorType implements ErrorType {

    INVALID_REQUEST("040001", "无效请求"),
    INVALID_CLIENT("040002", "无效client_id"),
    INVALID_GRANT("040003", "无效授权"),
    INVALID_SCOPE("040004", "无效scope"),
    INVALID_TOKEN("040005", "无效token"),
    INSUFFICIENT_SCOPE("040010", "授权不足"),
    REDIRECT_URI_MISMATCH("040020", "redirect url不匹配"),
    ACCESS_DENIED("040030", "拒绝访问"),
    METHOD_NOT_ALLOWED("040040", "不支持该方法"),
    SERVER_ERROR("040050", "权限服务错误"),
    UNAUTHORIZED_CLIENT("040060", "未授权客户端"),
    UNAUTHORIZED("040061", "未授权"),
    UNSUPPORTED_RESPONSE_TYPE("040070", " 支持的响应类型"),
    UNSUPPORTED_GRANT_TYPE("040071", "不支持的授权类型"),
    WEIXI_CODE_ERROR("040080","微信受授权码错误"),
    WEIXI_USER_EMPTY("040081","微信用户不存在请注册"),
    WEIXI_CODE_EMPTY("040082","微信授权码不能为空"),
    CAPTCHA_EMPTY("040083","验证码不能为空"),
    CAPTCHA_ERROR("040084","验证码错误"),
    SMS_CODE_ERROR("040085","短信验证码错误"),
    SMS_CODE_EMPTY("040086","短信验证码不能为空"),
    MOBILE_EMPTY("040087","手机号不能为空"),
    PASSWORD_EXC_NUM("040088","密码错误5次，账号被锁定10分钟，请稍后再试"),
    ACCOUNT_PWD_ERROR("040089", "密码格式错误"),
    ACCT_PWD_ERROR("040090","手机号未注册"),
    CODE_FREQUENT("040091","获取验证码过于频繁");


    /**
     * 错误类型码
     */
    private String code;
    /**
     * 错误类型描述信息
     */
    private String mesg;

    AuthErrorType(String code, String mesg) {
        this.code = code;
        this.mesg = mesg;
    }

}
